import util.ListNode;

/**
 * Created by losor on 2016/9/22.
 */
public class _2_AddTwoNumber {
    public static void main(String[] args) {

    }
    public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {
        if (l1 == null){
            return null;
        }
            ListNode listNode = new ListNode(l1.val + l2.val);
            listNode = listNode.next;
            l1 = l1.next;
            l2 = l2.next;
        while (l1 != null){
            listNode = new ListNode(l1.val + l2.val);
            listNode = listNode.next;
            l1 = l1.next;
            l2 = l2.next;
        }
        return listNode;
    }
}

